package com.zhuiyun.project.api.complaint.controller;

import com.zhuiyun.project.annotation.OptLog;
import com.zhuiyun.project.api.complaint.model.Complaintmodel;
import com.zhuiyun.project.api.complaint.service.ComplaintService;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.utils.constants.CommonConstants;
import com.zhuiyun.project.utils.pageUtil.PageRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ComplaintController
 * @Description TODO
 * @Author DF
 * @Date 2023/12/13 14:20
 **/
@RestController
@RequestMapping("/complaint")
@Api(tags = "投诉管理")
@Slf4j
public class ComplaintController {
    @Autowired
    private ComplaintService complaintService;
    /**
    *
    * @Author jxz
    * @Description 投诉的分页查询
    * @Date 2023/12/13 14:26
    * @Return CommonResult
    * @param complaintmodel,complaintmodel
    **/
    @GetMapping("/selectall")
    @OptLog(modular = "投诉管理", type = CommonConstants.SELECT, describe = "查询投诉")
    @ApiOperation(value = "分页查询投诉")
    public CommonResult PageComplaintSelect(Complaintmodel complaintmodel, PageRequest pageRequest){
        return complaintService.SelectAll(complaintmodel,pageRequest);
    }
    /**
     *
     * @Author DF
     * @Description
     * @Date 2023/12/14 14:34
     * @Return [com.zhuiyun.project.api.complaint.model.Complaintmodel, com.zhuiyun.project.utils.pageUtil.PageRequest]
     * @param complaintmodel
     * @param pageRequest,complaintmodel
     **/
    @GetMapping("/selectone")
    @OptLog(modular = "投诉管理", type = CommonConstants.SELECT, describe = "单查询投诉")
    @ApiOperation(value = "单查询投诉")
    public CommonResult PageComplaintSelectOne(Complaintmodel complaintmodel, PageRequest pageRequest){
        return complaintService.Selectone(complaintmodel,pageRequest);
    }

}
